UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oaajYl+2RA14p6QOWyXu93hyozVbEGi479Mb/QRqWLI=' 
WHERE 
  key_id = 'c1c68c4dbc2fc4fa6947375ff9c6cf573d8ede92ebe9ab21d077e48926750b86' 
  AND (
    token = 'oaajYl+2RA14p6QOWyXu93hyozVbEGi479Mb/QRqWLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050