UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ZAF91nYh+3EW4nphjhdauyNH19NSXkM1TZqRM6UCAo=' 
WHERE 
  key_id = '7aea8800eb3edc092b9120c59ec3a55f88b40a7b88761a5ae192b7f4e4906270' 
  AND (
    token = '/ZAF91nYh+3EW4nphjhdauyNH19NSXkM1TZqRM6UCAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080