UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHCuSRImH5kGkUcog3Gk2BhqpRmOl2uL3ibifti1yVA=' 
WHERE 
  key_id = '58fed780e7c6ec89721073ddd0cc8735154d335c019c61eb53569c4b258887cd' 
  AND (
    token = 'FHCuSRImH5kGkUcog3Gk2BhqpRmOl2uL3ibifti1yVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024