UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jWXaxp8KIzY7O0rbdiOuadpXTLf4b0BFAogGdNbQ01A=' 
WHERE 
  key_id = '2efc5300aadb9ce128705963e3b801a995a1b0eebf7bf55ae6fc87975bd05960' 
  AND (
    token = 'jWXaxp8KIzY7O0rbdiOuadpXTLf4b0BFAogGdNbQ01A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034