UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qbbwi8AFCgRXRAqkG2sn5yKoAg6CibIqGbf+kVwpYI8=' 
WHERE 
  key_id = 'df2a24f4767a62ccf02777f517fdf36b4420e19bef7c17f1fa312f36c21fee0a' 
  AND (
    token = 'Qbbwi8AFCgRXRAqkG2sn5yKoAg6CibIqGbf+kVwpYI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034