UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YnfOykb9cBCY1lpSKwW/QaUYvrni0xJ+JiiV0TpdMDo=' 
WHERE 
  key_id = '4ebecf2c0032b3fb4b5bdf3520d0fd46f54e64757094abbf53140530a13abf23' 
  AND (
    token = 'YnfOykb9cBCY1lpSKwW/QaUYvrni0xJ+JiiV0TpdMDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050