UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sD+0sAjCzHkQ/YrFVN0BbZpS/w29KmVsDbJwiYljX9c='
WHERE
key_id = '816647834c178318b46af72e029dace03a4df602526c0880d94274e03a269887'
AND (
token = 'sD+0sAjCzHkQ/YrFVN0BbZpS/w29KmVsDbJwiYljX9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)