UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6WySu04LKrnCucJouj9OwZQz1eV/8YfUQ9+vl56zZBc='
WHERE
key_id = '9c5279d9dd8d8d7b00d1e58e923182717ed8624a20b3048a01d3984288394350'
AND (
token = '6WySu04LKrnCucJouj9OwZQz1eV/8YfUQ9+vl56zZBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)