UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+UZuwaMYSLskn8GweR2eRVLpVgPBIaHionJdZ2v5skM=' 
WHERE 
  key_id = '3b1b29a605418513e8f2a4329b6b62d233e1c6790cbd50836b32f694a3774fa0' 
  AND (
    token = '+UZuwaMYSLskn8GweR2eRVLpVgPBIaHionJdZ2v5skM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070