UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WuVbugXJ6y6RE45XtqX9sJmItBK1ofgPbSfx6y2StTc='
WHERE
key_id = '473a73a8b5e7a53b46f46938a6c57019bcea73e8b0b1bf8481086256a32ff9b5'
AND (
token = 'WuVbugXJ6y6RE45XtqX9sJmItBK1ofgPbSfx6y2StTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)