UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSBXER6xruWvv2IHjTH3xZriEoFyeGBAYGW8SGy6Wys=' 
WHERE 
  key_id = '5d3c96f8fecbcb1a9e79324dcd7d8a69fc14087cb278c390473ae95e9cff8f32' 
  AND (
    token = 'kSBXER6xruWvv2IHjTH3xZriEoFyeGBAYGW8SGy6Wys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015