UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNDAaw42Xv57j2Ia278aKQhKsvGLdwxDIMlZlOgxSTo='
WHERE
key_id = '8a73bb2164863b1d0f0c4125441250782170eaa357cc3a40b8a8ae4f107de7a4'
AND (
token = 'JNDAaw42Xv57j2Ia278aKQhKsvGLdwxDIMlZlOgxSTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)