UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZLgow9dldcqYlR9qJPlYphhVC4ZHZBz5rr6JIssEpg='
WHERE
key_id = '25976a41446feec1c8f75e3df4fef818cd613cb7a16a6d65125f9e2f84dfac06'
AND (
token = 'fZLgow9dldcqYlR9qJPlYphhVC4ZHZBz5rr6JIssEpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)