UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ic4mvKwGxiiHp7bJ0BbtRX1hXB9iI7TwuPbWCnU5xA8='
WHERE
key_id = '2a3dc83a25f0bde448cf6857b393ed21f9b9ca62cb77d253c9f35d9d6ab7ed17'
AND (
token = 'ic4mvKwGxiiHp7bJ0BbtRX1hXB9iI7TwuPbWCnU5xA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)