UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hc2kiEyuMxNinKOgUEX2cIj+PZQQa9v/aR2CfbukIpc='
WHERE
key_id = '6c96df2daa578fbb5b90667ac8ea7dd006c06ba6ba6538ac98edc8f7bd5a7497'
AND (
token = 'Hc2kiEyuMxNinKOgUEX2cIj+PZQQa9v/aR2CfbukIpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)