UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mUu4G/y8qNnlsgsnw5/rB9XpOcHpEL0AZJVcZDx+d74='
WHERE
key_id = '2713c821cb62cf5a9b2000ff7495ecb0d3d0d4fb0d8a50b923345e5ef1b4f7a4'
AND (
token = 'mUu4G/y8qNnlsgsnw5/rB9XpOcHpEL0AZJVcZDx+d74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)