UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJrTmiggtlj0SO/qyW3ZRhoeS0X8vx50q8tZKvsysjQ=' 
WHERE 
  key_id = '0b0e19ec421e6769ebd460278857af440048a03fc90ea21783e7f8b053fcb7a9' 
  AND (
    token = 'EJrTmiggtlj0SO/qyW3ZRhoeS0X8vx50q8tZKvsysjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029