UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tXnMagY+fx1n30wd6UCZ4kO45sImibTq1HB/QaDkJmk='
WHERE
key_id = '9e20663d5503e2cd73aa282c0ea3d5009c798b7bb38449968f68440700816a5c'
AND (
token = 'tXnMagY+fx1n30wd6UCZ4kO45sImibTq1HB/QaDkJmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)