UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tgzvTw7wI2EV1Q8kCGtkz5WaZSZYSDAbIrrkUdL+xOI='
WHERE
key_id = 'd5856cf14a371936fca61004576a494021b2db330d42a74d0e86040c3123ed68'
AND (
token = 'tgzvTw7wI2EV1Q8kCGtkz5WaZSZYSDAbIrrkUdL+xOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)