UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wvhLT28Z+fRVPlJBiPBi7F7fp4Wx6N6foZuMb7MXSNA='
WHERE
key_id = 'ab0a7e91e03f5b658b4661c5d2de9d2518adb1b5af7b5d9b1efe30886358351e'
AND (
token = 'wvhLT28Z+fRVPlJBiPBi7F7fp4Wx6N6foZuMb7MXSNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)