UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GwGtKe5HqNEjPsDIelVl77LKMriMGMOo7OYQr/ObNXg='
WHERE
key_id = 'd6e960b01ab8e7abd5ee01124da61af63999a7f52ecc61190bae7c0244418acb'
AND (
token = 'GwGtKe5HqNEjPsDIelVl77LKMriMGMOo7OYQr/ObNXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)