UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/sm7SC6i9lPwJxkEsJcwMKY0NI6C/iq9F9RteZ8N9Q=' 
WHERE 
  key_id = '3cd5a08e3a4d07c7c7597ae82c0a5d5952c8370456e536de10787fab71782dd1' 
  AND (
    token = 'l/sm7SC6i9lPwJxkEsJcwMKY0NI6C/iq9F9RteZ8N9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053