UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0SmMLu5MI8YfFQZ5uJiPyxYp4p1B9JeJP0MjNEYdtYw=' 
WHERE 
  key_id = 'bee46c8b87f2f2fadb6540136f37727daed256a00db52ac5636cfc46598bed70' 
  AND (
    token = '0SmMLu5MI8YfFQZ5uJiPyxYp4p1B9JeJP0MjNEYdtYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028