UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOflSnOAgrylwx+e/OvpqSq0rOMuHBCcJtORBZfL2lc='
WHERE
key_id = '5036915fa5f16cd4bad00a4808905a27c53903649d705f4990f30ada11a78d14'
AND (
token = 'QOflSnOAgrylwx+e/OvpqSq0rOMuHBCcJtORBZfL2lc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)