UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3MKVb1IidFnXp1xz9wz1/lNC7b+1oOpVwmh4e3MTbjw=' 
WHERE 
  key_id = '1344fd5d6f0e9ac816e7d5473014ea4137116c5c4531466dd84a3a5ffc90da7d' 
  AND (
    token = '3MKVb1IidFnXp1xz9wz1/lNC7b+1oOpVwmh4e3MTbjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023