UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GkuxHK3ngWkC4wAXIPtEfcjMPB8KMkiq95TZ0RK1K/s=' 
WHERE 
  key_id = 'e3ba2cf176724291f080806efa7fdff7fc998e338688bf9c07fc3bcc2110d669' 
  AND (
    token = 'GkuxHK3ngWkC4wAXIPtEfcjMPB8KMkiq95TZ0RK1K/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063