UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Qu9XKd0/Q7A4nQGl8gFBopq+yy325nY4Zbq12KhNME=' 
WHERE 
  key_id = '20bea54d263512bf1ccfa79c0d5778f28e4b87060ba532005cecff35e3a2054a' 
  AND (
    token = '6Qu9XKd0/Q7A4nQGl8gFBopq+yy325nY4Zbq12KhNME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029