UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4Cl6znpvzWkZwXEfL9+tWQHmcHiP/uXY/vdi3Ggdnc=' 
WHERE 
  key_id = '819d461582974f0a1b97068e2709c7f8f8aae52618e8938e0dfc5a9e3f90d19b' 
  AND (
    token = 'G4Cl6znpvzWkZwXEfL9+tWQHmcHiP/uXY/vdi3Ggdnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031