UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zDSllXjjdNCupQIWtQf7HQ03+J19lZiUAFe+qaOhyoU=' 
WHERE 
  key_id = 'a3688cab764bd6749d8cae13cda834c868b81b2470bb0db6047c8731a7e2a293' 
  AND (
    token = 'zDSllXjjdNCupQIWtQf7HQ03+J19lZiUAFe+qaOhyoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037