UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HkJOYfh6IPPvY4k265wmdCZ+g9QCxjH4wCnuhOae2hA=' 
WHERE 
  key_id = '1f8d1c7c4ac5aabb0c50beb118b16002615a802122e7760c331ee0c14a27ea8e' 
  AND (
    token = 'HkJOYfh6IPPvY4k265wmdCZ+g9QCxjH4wCnuhOae2hA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035