UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MHXKd4Ze2c1IV9/Wf+KdJ/m6XZ4ZQPhG+XQx2nazaHA='
WHERE
key_id = '0eb20e2d8c349401ffbb1de8fe5abcafd9f3b97bb5261a4297ffeef443c7d9a6'
AND (
token = 'MHXKd4Ze2c1IV9/Wf+KdJ/m6XZ4ZQPhG+XQx2nazaHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)