UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S5LUrrh18tm6QZgdGfwyydJTpMS6cznmfY37Qf3tT8Q=' 
WHERE 
  key_id = '855ed4125e4051c29efdf92e4db51c5ddae846cfb77f8352648a398baace53b3' 
  AND (
    token = 'S5LUrrh18tm6QZgdGfwyydJTpMS6cznmfY37Qf3tT8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029