UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6XDzBXL5I9QqNqV9X80tMbNmCNf75SBxmDgVZk143sA='
WHERE
key_id = '79611ebbded81c9527a3144dc7c57c7a8c27e6ee1c42c4ef848e44dfec462f2d'
AND (
token = '6XDzBXL5I9QqNqV9X80tMbNmCNf75SBxmDgVZk143sA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)