UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7XaSQUBNEuQw9SaL55+f+UHhaRwMDzex5G3I4Xz2pYw=' 
WHERE 
  key_id = 'e9be7c71389517385b092c3238df3446246bf495bf9df47a684b35d4e60583b3' 
  AND (
    token = '7XaSQUBNEuQw9SaL55+f+UHhaRwMDzex5G3I4Xz2pYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042