UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gMF89ofSsulIPf3BTRcHuUdP3nF4VYOmscsoPbMAdNI='
WHERE
key_id = '15b528ba3d4d973f0a789a1109ba2891fa7c8ee8c0bcaa2d7231b8bdb1aa35ba'
AND (
token = 'gMF89ofSsulIPf3BTRcHuUdP3nF4VYOmscsoPbMAdNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)