UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rkx4jcZG8rQCLiE2sBaJaNgCbMVE7OE01XX/L4xLJOY=' 
WHERE 
  key_id = 'd2e132db74ef08c88a8568a02cc583f6d8b35aef64d105a4c2bfbef6fb9ddadf' 
  AND (
    token = 'rkx4jcZG8rQCLiE2sBaJaNgCbMVE7OE01XX/L4xLJOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038