UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LG2EyiPsZlMIjvRI14CdbR7TW1q6L4WIMS2Pj7Pa25o='
WHERE
key_id = '8a95d02fb03065063f103f1758c64454de5093b93f13a18d4a8c9641611b77f5'
AND (
token = 'LG2EyiPsZlMIjvRI14CdbR7TW1q6L4WIMS2Pj7Pa25o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)