UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I+p88LIXtYnjkyNpgsdwc5OKFnIyruPunp12nc0QMTU='
WHERE
key_id = 'ebe559bceb95539804d3975ea5f3571ee7453f293314160acbaa32ec202b17ad'
AND (
token = 'I+p88LIXtYnjkyNpgsdwc5OKFnIyruPunp12nc0QMTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)