UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLD8UtBZyTkMWq8APBvXov1RBbXmXMx0zdYC8DC69fs='
WHERE
key_id = '09bf418cf8d54e331a3d3edb7d1ed1adc6dc5ee4ef1ea2ca47a18b30097dfa6b'
AND (
token = 'nLD8UtBZyTkMWq8APBvXov1RBbXmXMx0zdYC8DC69fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)