UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BDo+i22CkV3K4Wkr+CVhso/gRLz/+J5JQm2hv04W1oQ=' 
WHERE 
  key_id = '1dd8276db935f47bdef219b0a8739cd8e2f16d294860c7d16bc8dbfca1546f05' 
  AND (
    token = 'BDo+i22CkV3K4Wkr+CVhso/gRLz/+J5JQm2hv04W1oQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038