UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mTFqjk2A6GNn6SmEn6E5wZwxDyGZt8nR8SN4V+YWNqc=' 
WHERE 
  key_id = '5bedbe21e33fc4fc33c84fc9b3ccc3a2c455b5f78a801e183e24b3484bc3dac0' 
  AND (
    token = 'mTFqjk2A6GNn6SmEn6E5wZwxDyGZt8nR8SN4V+YWNqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018