UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MoNpUMGbGanX5uD60Ekm8QGDKUE/LbaEWJVnagwNLeg='
WHERE
key_id = '82b1ba86cd591ec0650e60d4c0ab0033bfa7d8724901478a3d82e43a1dd59051'
AND (
token = 'MoNpUMGbGanX5uD60Ekm8QGDKUE/LbaEWJVnagwNLeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)