UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pAzbhHS5mg3H61Lpy1YpIU/7vFDuCGCT+aMt/TA8k6g=' 
WHERE 
  key_id = '803186bdecf48d15a7dc0e9c2f99b25b39dd17f0d252e270c9de0f1eeaa86bf1' 
  AND (
    token = 'pAzbhHS5mg3H61Lpy1YpIU/7vFDuCGCT+aMt/TA8k6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040