UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LShuBu7EUvBZ1LETXSWdwKMnef3GbDjLBw+m85lSw14=' 
WHERE 
  key_id = '60fc1d58980d4db1c307893e8d3e68bd5cafec637fa1d8722e90ac78b923e33f' 
  AND (
    token = 'LShuBu7EUvBZ1LETXSWdwKMnef3GbDjLBw+m85lSw14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043