UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KGvx1yEGIqJexif40shK/koaRM+HTI2dDox7cpuKS/Y='
WHERE
key_id = '3c0c4509a372aeaa6cdf8017a364463bd77a79ac9c5a622ad732826f8f315ace'
AND (
token = 'KGvx1yEGIqJexif40shK/koaRM+HTI2dDox7cpuKS/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)