UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dpa3DbUU/xWnAh67DFQ4kt1esTyWGCTgv73144+erG4='
WHERE
key_id = 'e11b5f26bdd2e69392284196f6239b02d985f09e4ec9c2f1db2853be526d3416'
AND (
token = 'dpa3DbUU/xWnAh67DFQ4kt1esTyWGCTgv73144+erG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)