UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPC52Yw+M5IU78E1Kk7GIvy/3KTkookbux1vcgCyA+0='
WHERE
key_id = '78bbeaae1fe14b2ae7264175c3f12a7883a3ff2ec359a8f5cabbb7a1425b48e7'
AND (
token = 'oPC52Yw+M5IU78E1Kk7GIvy/3KTkookbux1vcgCyA+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)