UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R6gG898yKAnEvOl8MLvQy4xxB4zqi8WcQ+M/mzWHG8o='
WHERE
key_id = 'bd9d100d4fcddcbaba06ec7af5d4edb16ed11e18f59f5ad0d02e0a337b133c94'
AND (
token = 'R6gG898yKAnEvOl8MLvQy4xxB4zqi8WcQ+M/mzWHG8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)