UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oMeh+oAvU0QvmLvjaq4kjlB9yLB+Z61HQX3FQ1ci0I8=' 
WHERE 
  key_id = '6341121d09b10ab62d6aad9e9ca0a45605bfbb6c9c51cedeae378e4d39cff013' 
  AND (
    token = 'oMeh+oAvU0QvmLvjaq4kjlB9yLB+Z61HQX3FQ1ci0I8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020