UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItsPcnRk4gChTkGNW+QE6PXRSJmC6Hb1VxiFd2RKTlc='
WHERE
key_id = '1361388d46d367dec8e2aa81897370b29ab794a5f5fa6b2e589081f31c53d301'
AND (
token = 'ItsPcnRk4gChTkGNW+QE6PXRSJmC6Hb1VxiFd2RKTlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)